package spring.boot.adminx.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class WelcomeController {

	@GetMapping("/welcome")
	@PreAuthorize("true")
	public String welcome(){
		return "welcome/welcome";
	}

	@GetMapping("/welcome1")
	@PreAuthorize("true")
	public String welcome1(Model model){

		JSONArray values = new JSONArray();
		values.add(8200);
		values.add(9320);
		values.add(9010);
		values.add(9340);
		values.add(12900);
		values.add(13300);
		values.add(13200);
		model.addAttribute("values", values);

		return "welcome/welcome1";
	}

	@GetMapping("/welcome2")
	@PreAuthorize("true")
	public String welcome2(){
		return "welcome/welcome2";
	}
}
